gdk: Improve struct packing in places
authorMatthias Clasen <mclasen@redhat.com>
Sat, 25 Jul 2020 02:57:00 +0000 (22:57 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 25 Jul 2020 15:57:37 +0000 (11:57 -0400)
Plug some holes in our structs by rearranging
a few fields. This is was done looking at
pahole output.

gdk/gdkcontentdeserializer.c
gdk/gdkcontentserializer.c
gdk/gdkdeviceprivate.h
gdk/gdksurfaceprivate.h
gdk/x11/gdkkeys-x11.c

index b372dc48475ee6538aa1a39943473e8cba90d3e4..5ee2fd35b8ea6a9d7720220e120ea4496beb4af1 100644 (file)
@@ -68,6 +68,7 @@ struct _GdkContentDeserializer
   GValue value;
   GInputStream *stream;
   int priority;
+  gboolean returned;
   GCancellable *cancellable;
   gpointer user_data;
   GAsyncReadyCallback callback;
@@ -77,7 +78,6 @@ struct _GdkContentDeserializer
   GDestroyNotify task_notify;
 
   GError *error;
-  gboolean returned;
 };
 
 struct _GdkContentDeserializerClass
index aa22980f71ce845ae179fa805de969dd94f321c2..ea42397f999ea62f14466f32dbe419d7d7028623 100644 (file)
@@ -70,6 +70,7 @@ struct _GdkContentSerializer
   GValue value;
   GOutputStream *stream;
   int priority;
+  gboolean returned;
   GCancellable *cancellable;
   gpointer user_data;
   GAsyncReadyCallback callback;
@@ -79,7 +80,6 @@ struct _GdkContentSerializer
   GDestroyNotify task_notify;
 
   GError *error;
-  gboolean returned;
 };
 
 struct _GdkContentSerializerClass
index 07184a3abe136156bb9617496bf793c3c79c309c..93c7b7a558233be64e8ba3768b0e15656261c23d 100644 (file)
@@ -40,13 +40,13 @@ struct _GdkDevice
   GdkInputSource source;
   gboolean has_cursor;
   GdkAxisFlags axis_flags;
+  GdkDeviceType type;
   GdkDisplay *display;
   /* The paired logical device for logical devices,
    * or the associated logical device for physical ones
    */
   GdkDevice *associated;
   GList *physical_devices;
-  GdkDeviceType type;
   GArray *axes;
   guint num_touches;
 
index 5d750bfe2e1f1fde56ef82b7ba6cc9785ae681df..55febf1dce4d58854ed7fe624caccc7dfc3b5672 100644 (file)
@@ -48,8 +48,6 @@ struct _GdkSurface
   int x;
   int y;
 
-  guint8 resize_count;
-
   GdkGLContext *gl_paint_context;
 
   cairo_region_t *update_area;
@@ -63,16 +61,17 @@ struct _GdkSurface
   GdkSurfaceState old_state;
   GdkSurfaceState state;
 
+  guint8 resize_count;
+
   guint8 alpha;
   guint8 fullscreen_mode;
 
   guint modal_hint : 1;
-
   guint destroyed : 2;
-
   guint in_update : 1;
   guint frame_clock_events_paused : 1;
   guint autohide : 1;
+  guint shortcuts_inhibited : 1;
 
   struct {
     GdkGravity surface_anchor;
@@ -101,7 +100,6 @@ struct _GdkSurface
 
   cairo_region_t *opaque_region;
 
-  guint shortcuts_inhibited : 1;
   GdkSeat *current_shortcuts_inhibited_seat;
 };
 
index 689c6b330ed26a5893badfb25ab4d814c21cde77..6e27537b568c285e34136b8d5e954954c65c5600 100644 (file)
@@ -55,8 +55,8 @@ typedef struct _DirectionCacheEntry DirectionCacheEntry;
 struct _DirectionCacheEntry
 {
   guint serial;
-  Atom group_atom;
   PangoDirection direction;
+  Atom group_atom;
 };
 
 struct _GdkX11Keymap